<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>png++: error.hpp Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />



</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">png++
   &#160;<span id="projectnumber">0.2.1</span>
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="headertitle">
<div class="title">error.hpp</div>  </div>
</div><!--header-->
<div class="contents">
<a href="error_8hpp.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment"> * Copyright (C) 2007,2008   Alex Shulgin</span>
<a name="l00003"></a>00003 <span class="comment"> *</span>
<a name="l00004"></a>00004 <span class="comment"> * This file is part of png++ the C++ wrapper for libpng.  PNG++ is free</span>
<a name="l00005"></a>00005 <span class="comment"> * software; the exact copying conditions are as follows:</span>
<a name="l00006"></a>00006 <span class="comment"> *</span>
<a name="l00007"></a>00007 <span class="comment"> * Redistribution and use in source and binary forms, with or without</span>
<a name="l00008"></a>00008 <span class="comment"> * modification, are permitted provided that the following conditions are met:</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * 1. Redistributions of source code must retain the above copyright notice,</span>
<a name="l00011"></a>00011 <span class="comment"> * this list of conditions and the following disclaimer.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * 2. Redistributions in binary form must reproduce the above copyright</span>
<a name="l00014"></a>00014 <span class="comment"> * notice, this list of conditions and the following disclaimer in the</span>
<a name="l00015"></a>00015 <span class="comment"> * documentation and/or other materials provided with the distribution.</span>
<a name="l00016"></a>00016 <span class="comment"> *</span>
<a name="l00017"></a>00017 <span class="comment"> * 3. The name of the author may not be used to endorse or promote products</span>
<a name="l00018"></a>00018 <span class="comment"> * derived from this software without specific prior written permission.</span>
<a name="l00019"></a>00019 <span class="comment"> *</span>
<a name="l00020"></a>00020 <span class="comment"> * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS&#39;&#39; AND ANY EXPRESS OR</span>
<a name="l00021"></a>00021 <span class="comment"> * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES</span>
<a name="l00022"></a>00022 <span class="comment"> * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN</span>
<a name="l00023"></a>00023 <span class="comment"> * NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,</span>
<a name="l00024"></a>00024 <span class="comment"> * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED</span>
<a name="l00025"></a>00025 <span class="comment"> * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR</span>
<a name="l00026"></a>00026 <span class="comment"> * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF</span>
<a name="l00027"></a>00027 <span class="comment"> * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING</span>
<a name="l00028"></a>00028 <span class="comment"> * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS</span>
<a name="l00029"></a>00029 <span class="comment"> * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.</span>
<a name="l00030"></a>00030 <span class="comment"> */</span>
<a name="l00031"></a>00031 <span class="preprocessor">#ifndef PNGPP_ERROR_HPP_INCLUDED</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#define PNGPP_ERROR_HPP_INCLUDED</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="preprocessor">#include &lt;stdexcept&gt;</span>
<a name="l00035"></a>00035 <span class="preprocessor">#include &lt;cerrno&gt;</span>
<a name="l00036"></a>00036 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
<a name="l00037"></a>00037 
<a name="l00038"></a>00038 <span class="keyword">namespace </span>png
<a name="l00039"></a>00039 {
<a name="l00040"></a>00040 
<a name="l00045"></a><a class="code" href="classpng_1_1error.html">00045</a>     <span class="keyword">class </span><a class="code" href="classpng_1_1error.html" title="Exception class to represent runtime errors related to png++ operation.">error</a>
<a name="l00046"></a>00046         : <span class="keyword">public</span> std::runtime_error
<a name="l00047"></a>00047     {
<a name="l00048"></a>00048     <span class="keyword">public</span>:
<a name="l00052"></a><a class="code" href="classpng_1_1error.html#a4026c180a001f2b4dd40e210cb04d895">00052</a>         <span class="keyword">explicit</span> <a class="code" href="classpng_1_1error.html#a4026c180a001f2b4dd40e210cb04d895">error</a>(std::string <span class="keyword">const</span>&amp; message)
<a name="l00053"></a>00053             : std::runtime_error(message)
<a name="l00054"></a>00054         {
<a name="l00055"></a>00055         }
<a name="l00056"></a>00056     };
<a name="l00057"></a>00057 
<a name="l00064"></a><a class="code" href="classpng_1_1std__error.html">00064</a>     <span class="keyword">class </span><a class="code" href="classpng_1_1std__error.html" title="Exception class to represent standard library errors (generally IO).">std_error</a>
<a name="l00065"></a>00065         : <span class="keyword">public</span> std::runtime_error
<a name="l00066"></a>00066     {
<a name="l00067"></a>00067     <span class="keyword">public</span>:
<a name="l00076"></a><a class="code" href="classpng_1_1std__error.html#a4a636ba53d16b572178d43761200d711">00076</a>         <span class="keyword">explicit</span> <a class="code" href="classpng_1_1std__error.html#a4a636ba53d16b572178d43761200d711">std_error</a>(std::string <span class="keyword">const</span>&amp; message, <span class="keywordtype">int</span> <a class="code" href="classpng_1_1error.html" title="Exception class to represent runtime errors related to png++ operation.">error</a> = errno)
<a name="l00077"></a>00077             : std::runtime_error((message + <span class="stringliteral">&quot;: &quot;</span>) + strerror(<a class="code" href="classpng_1_1error.html" title="Exception class to represent runtime errors related to png++ operation.">error</a>))
<a name="l00078"></a>00078         {
<a name="l00079"></a>00079         }
<a name="l00080"></a>00080     };
<a name="l00081"></a>00081 
<a name="l00082"></a>00082 } <span class="comment">// namespace png</span>
<a name="l00083"></a>00083 
<a name="l00084"></a>00084 <span class="preprocessor">#endif // PNGPP_ERROR_HPP_INCLUDED</span>
</pre></div></div><!-- contents -->


<hr class="footer"/><address class="footer"><small>
Generated on Fri Jan 25 2013 14:10:10 for png++ by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
